package cn.openread.demo.multithread.lock;

import java.util.Collection;
import java.util.Iterator;

public class Demo {

    public static void main(String[] args) {

        LikeSearch<String> likeSearch = new LikeSearch<>();
        likeSearch.put("河北是个好地方", "河北是个好地方");
        likeSearch.put("河南是个好地方", "河南是个好地即");
        likeSearch.put("湖南是个好地方", "湖南是个好难受");
        Collection<String> search = likeSearch.search("好地方", 10);
        for (Iterator it = search.iterator(); it.hasNext(); ) {
            System.out.println(it.next());
        }
    }
}
